<?php session_start(); ?>

<html>
<head>
</head>
	<body>
	<form id="sform" name="sform" method="post" action="" >
	<table>
		<th align="left" colspan="2">SEARCH</th>
		<tr>
			<td> <input type="radio" name="roomNo" value="1" /> Resident's <b>Room Number</b> </td>
		</tr>
		<tr>
			<td> <input type="radio" name="basicInfo" value="2" /> Resident's <b>Basic Information</b> </td>
		</tr>
		<tr>
			<td> <input type="radio" name="parentInfo" value="3" /> Resident's <b>Parent's Information</b> </td>
		</tr>
		<tr>
			<td> <input type="radio" name="guardianInfo" value="4" />Resident's <b>Guardian Information</b> </td>
		</tr>
		<tr>
			<td> <input type="radio" name="checkIn" value="5" /> Resident's <b>Check-In Information</b> </td>
		</tr>
		<tr>
			<td><b>SEARCH BY:</b> <input name="snumButton" type="submit" id="snumButton" value="Student Number"/>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<input name="nameButton" type="submit" id="nameButton" value="Name"/></td>
		</tr>
	
	
	</table>
	
	</form>
	</body>

</html>

<?php

	if($_POST['roomNo']==1) $category = 1;
	else if($_POST['basicInfo']==2) $category = 2;
	else if($_POST['parentInfo']==3) $category = 3;
	else if($_POST['guardianInfo']==4) $category = 4;
	else if($_POST['checkIn']==5) $category = 5;
	else echo '<script>alert("Please Choose a Category.")</script>';
	
	$_SESSION['category'] = $category;

	if(isset($_POST['snumButton']))
	{
		header("Location:enterSnum.php");
	}else if(isset($_POST['nameButton'])){
		header("Location:enterName.php");
	}
?>